<?php
	####################################################
	# Hex 헥스코드 스트링 변환                         #
	####################################################
	class Hex {
		public static function str2hex($x) {
			$s='';
			foreach(str_split($x) as $c) $s.=sprintf("%02X",ord($c));
			return($s);
		}
		public static function hex2str($x) {
			$s='';
			foreach(explode("\n",trim(chunk_split($x,2))) as $h) $s.=chr(hexdec($h));
			return($s);
		}
	}
?>